Hello,
I understand your concern. From your description of the pain it seems you are experiencing nighttime leg cramping, which is a condition that causes strong, painful and sudden muscle contractions, usually ocurring just after falling asleep.
The reasons can be many. The most frequent causes is low
magnesium, calcium or potassium levels in the blood, which can be quite common during
pregnancy.
Also, exercising or overusing the muscles during a strenuous physical activity and even an injury can cause these type of cramps.
Dehydration can also be a plausible cause. More rare causes can be exposure to clod temperatures and sleeping on a hard surface or uncomfortable mattress.
Certain medications such as
cholesterol lowering drugs, contraceptives,
steroids or diuretics can also be possible culprits.
If none of these apply to you and this condition does not improve, then it is best to see a doctor for a thorough check up and further investigation.
I hope this helps.
Wishing you all the best.